{% extends "forum/forumbase.html" %}

{% comment %}
#    Copyright 2012 New Mexico EPSCoR
#
#    This file is part of Teacher's P.E.T.
#
#    Teacher's P.E.T. is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    Teacher's P.E.T. is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Teacher's P.E.T..  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}

{% block subtitle %} | Forum {% if not TheThread %}New Thread{% else %}{% if TheEntry %}Edit Entry{% else %}New Entry{% endif %}{% endif %}{% endblock subtitle %}

{% block css %}
    {{block.super}}
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/forum.css" >
{% endblock css %}

{% block content %}
<div class="forum-entries-index">
    <h1 class="forum-edit-title">{% if not TheThread %}New Thread{% else %}{% if TheEntry %}Edit Post{% else %}New Post{% endif %}{% endif %}</h1>
    <form action="." method="post" class="forum-edit-form">{% csrf_token %}
    <table class="forum-entries-table" cellpadding=0 cellspacing=0 border=0>
        <tr>
            <td></td>
            <td class="forum-edit-thread-title">
                
            </td>
        </tr>
        {% if ThreadForm %}
                   {{ThreadForm}}
                {% endif %}
       {% with entry=TheEntry hide_editing='True' hide_files='True' hide_likes='True' %}
            {% include "forum/forum/display_entry.html" %}
        {% endwith %}
        
        
        
        <tr class="forum-edit-row">
            <td class="forum-edit-buttons" colspan="100%">
                <button style="submit" class="forum-entries-button forum-edit-submit-button" name="Save" value="Save">Save</button>
                <button style="submit" class="forum-entries-button forum-edit-attach-button" name="Attach" value="Attach">Edit Attachments</button>
                <a class="forum-entries-button" href="
                {% if not TheThread %}
                    {% course_url forum_view_threads %}
                {% else %}
                    {% course_url forum_view_entries thread_id=TheThread.id %}{% if TheEntry %}?post={{TheEntry.entry_number}}{% endif %}
                {% endif %}
                ">Cancel</a>
            </td>
        </tr>
    </table>
    </form>
</div>
{% endblock content %}